package com.lnsf.service.impl;

import java.util.List;

import com.lnsf.dao.IUser_DetailDao;
import com.lnsf.dao.impl.User_DetailDaoImpl;
import com.lnsf.model.User_Detail;
import com.lnsf.model.Users;
import com.lnsf.service.IUser_DetailService;

public class User_DetailServiceImpl implements IUser_DetailService{
	private IUser_DetailDao user_detaildao = new User_DetailDaoImpl();
	@Override
	public List<User_Detail> select() {
		return user_detaildao.select();
	}

	@Override
	public int insert(User_Detail user_detail) {
		return user_detaildao.insert(user_detail);
	}

	@Override
	public int update(User_Detail user_detail) {
		return user_detaildao.update(user_detail);
	}

	@Override
	public int delete(User_Detail user_detail) {
		return user_detaildao.delete(user_detail);
	}

	@Override
	public User_Detail selectByUid(Users users) {
		List<User_Detail>  list = select();
		for (int i = 0; i < list.size(); i++)
		{
			if (list.get(i).getuId()==users.getuId())
			{
				return list.get(i);
			}
		}
		return null;
	}

}
